ccl: add integer overflow checks
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 May 2011 06:50:03 +0000 (23:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 23 May 2011 06:50:03 +0000 (23:50 -0700)
commit11525c50e0aeeb6ba00acf2ee9f19437c3083cb8
treeef3019576edace7d0e0a989d34e2a35dc932162d
parent4c55fde48a2f174639232c6ef0c01ef64e7b3fa4
ccl: add integer overflow checks

* ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
(IN_INT_RANGE): New macros.
(ccl_driver): Use them to check for integer overflow when
decoding a CCL program.  Many of the new checks are whether XINT (x)
fits in int; it doesn't always, on 64-bit hosts.  The new version
doesn't catch all possible integer overflows, but it's an
improvement.
src/ChangeLog
src/ccl.c